using UnityEngine;
using System.Collections;

public class MovimientoRaqueta : MonoBehaviour {

	private bool isLeft = true;
	public Camera cam; 
	public int deph = 18;
	

    void Update() {
			Vector3 mouse = Input.mousePosition;
			cam=Camera.mainCamera;
			Screen.showCursor = false;
            Vector3 direccion = cam.ScreenToWorldPoint(new Vector3(mouse.x,mouse.y,deph));
 			transform.position = direccion;
			
			if (Input.GetMouseButton(1) && isLeft ){
				transform.Rotate(new Vector3(-90,0,0));
				isLeft = false;
			}
			if (Input.GetMouseButton(0) && !isLeft ){
				transform.Rotate(new Vector3(90,0,0));
				isLeft = true;
			}
		
    }

}
